﻿public struct IntVec2 {
	public int X;
	public int Y;

	public static IntVec2 up = new IntVec2(0,1);
	public static IntVec2 down = new IntVec2(0,-1);
	public static IntVec2 left = new IntVec2(-1,0);
	public static IntVec2 right = new IntVec2(1,0);

	public IntVec2(int x, int y) {
		X = x;
		Y = y;
	}

	public static IntVec2 operator +(IntVec2 v1, IntVec2 v2) {
		return new IntVec2(v1.X + v2.X, v1.Y + v2.Y);
	}

	public static IntVec2 operator -(IntVec2 v1, IntVec2 v2) {
		return new IntVec2(v1.X - v2.X, v1.Y - v2.Y);
	}

	public static IntVec2 operator *(IntVec2 v, int f) {
		return new IntVec2(v.X * f, v.Y * f);
	}

	public static IntVec2 operator *(IntVec2 v1, IntVec2 v2) {
		return new IntVec2(v1.X * v2.X, v1.Y + v2.Y);
	}

	public static bool operator ==(IntVec2 v1, IntVec2 v2) {
		return v1.X == v2.X && v1.Y == v2.Y;
	}

	public static bool operator !=(IntVec2 v1, IntVec2 v2) {
		return !(v1 == v2);
	}

	public static bool operator >(IntVec2 v1, IntVec2 v2) {
		return v1.X > v2.X || v1.Y > v2.Y;
	}

	public static bool operator <(IntVec2 v1, IntVec2 v2) {
		return v1.X < v2.X && v1.Y < v2.Y;
	}

	public override string ToString() {
		return "(" + X + " , " + Y + ")";
	}
}
